using System;
using System.Diagnostics;

namespace Codeflows.Logging
{
    public class DefaultLogProvider : ILogProvider
    {
        static readonly TraceSource TraceSource = new TraceSource("Codeflows");

        public void Error(string message, Exception exception)
        {
            TraceSource.TraceEvent(TraceEventType.Error, 100, string.Format("{0}: {1}", message, exception));
        }

        public void Verbose(string format, params object[] arguments)
        {
            TraceSource.TraceEvent(TraceEventType.Verbose, 100, format, arguments);
        }

        public void Verbose(string message)
        {
            TraceSource.TraceEvent(TraceEventType.Verbose, 100, message);
        }

        public void Warning(string message)
        {
            TraceSource.TraceEvent(TraceEventType.Warning, 100, message);
        }

        public void Warning(string format, params object[] arguments)
        {
            TraceSource.TraceEvent(TraceEventType.Warning, 100, format, arguments);
        }

        public void Information(string message)
        {
            TraceSource.TraceEvent(TraceEventType.Information, 100, message);
        }

        public void Information(string format, params object[] arguments)
        {
            TraceSource.TraceEvent(TraceEventType.Information, 100, format, arguments);
        }
    }
}